3ddb79c0MOVXq8qZDQRGb6z64_xAwg xen/include/xen/pci_ids.h
3e54c38dlSCVdyVM4PKcrSfzLLxWUQ xen/include/xen/perfc.h
3e54c38de9SUSYSAwxDf_DwkpAnQFA xen/include/xen/perfc_defn.h
+42422fb0FVX-TJkSvAXnbfwMf19XFA xen/include/xen/physdev.h
3ddb79c04nQVR3EYM5L4zxDV_MCo1g xen/include/xen/prefetch.h
3e4540ccU1sgCx8seIMGlahmMfv7yQ xen/include/xen/reboot.h
40589969nPq3DMzv24RDb5LXE9brHw xen/include/xen/sched-if.h
* warnings from standard distro startup scripts.
*/
static enum { XC_OFF, XC_DEFAULT, XC_TTY, XC_SERIAL } xc_mode = XC_DEFAULT;
+static int xc_num = -1;
static int __init xencons_setup(char *str)
{
- if ( !strcmp(str, "tty") )
- xc_mode = XC_TTY;
- else if ( !strcmp(str, "ttyS") )
+ char *q;
+ int n;
+
+ if ( !strncmp(str, "ttyS", 4) )
xc_mode = XC_SERIAL;
- else if ( !strcmp(str, "off") )
+ else if ( !strncmp(str, "tty", 3) )
+ xc_mode = XC_TTY;
+ else if ( !strncmp(str, "off", 3) )
xc_mode = XC_OFF;
+
+ switch (xc_mode)
+ {
+ case XC_SERIAL:
+ n = simple_strtol( str+4, &q, 10 );
+ if ( q>str+4 ) xc_num = n;
+ break;
+
+ case XC_TTY:
+ n = simple_strtol( str+3, &q, 10 );
+ if ( q>str+3 ) xc_num = n;
+ break;
+ }
+printk("xc_num = %d\n",xc_num);
return 1;
}
__setup("xencons=", xencons_setup);
kcons_info.write = kcons_write;
}
- if ( xc_mode == XC_OFF )
- return __RETCODE;
-
- if ( xc_mode == XC_SERIAL )
+ switch ( xc_mode )
+ {
+ case XC_SERIAL:
strcpy(kcons_info.name, "ttyS");
- else
+ if ( xc_num == -1 ) xc_num = 0;
+ break;
+
+ case XC_TTY:
strcpy(kcons_info.name, "tty");
+ if ( xc_num == -1 ) xc_num = 1;
+ break;
+
+ default:
+ return __RETCODE;
+ }
register_console(&kcons_info);
+
return __RETCODE;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if ( xc_mode == XC_SERIAL )
{
DRV(xencons_driver)->name = "ttyS";
- DRV(xencons_driver)->minor_start = 64;
- DRV(xencons_driver)->name_base = 0;
+ DRV(xencons_driver)->minor_start = 64 + xc_num;
+ DRV(xencons_driver)->name_base = 0 + xc_num;
}
else
{
DRV(xencons_driver)->name = "tty";
- DRV(xencons_driver)->minor_start = 1;
- DRV(xencons_driver)->name_base = 1;
+ DRV(xencons_driver)->minor_start = xc_num;
+ DRV(xencons_driver)->name_base = xc_num;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
(void)ctrl_if_register_receiver(CMSG_CONSOLE, xencons_rx, 0);
}
- printk("Xen virtual console successfully installed as %s\n",
- DRV(xencons_driver)->name);
+ printk("Xen virtual console successfully installed as %s%d\n",
+ DRV(xencons_driver)->name,
+ DRV(xencons_driver)->name_base );
return 0;
}
#include <xen/softirq.h>
#include <xen/acpi.h>
#include <xen/console.h>
+#include <xen/serial.h>
#include <xen/trace.h>
#include <xen/multiboot.h>
#include <asm/bitops.h>
/* Give up the VGA console if DOM0 is configured to grab it. */
console_endboot(cmdline && strstr(cmdline, "tty0"));
+ /* Hide UART from DOM0 if we're using it */
+ serial_endboot();
+
domain_unpause_by_systemcontroller(current->domain);
domain_unpause_by_systemcontroller(dom0);
startup_cpu_idle_loop();
#include <asm/domain_page.h>
#include <xen/trace.h>
#include <xen/console.h>
+#include <xen/physdev.h>
#include <asm/shadow.h>
#include <public/sched_ctl.h>
case DOM0_PCIDEV_ACCESS:
{
- extern int physdev_pci_access_modify(domid_t, int, int, int, int);
ret = physdev_pci_access_modify(op->u.pcidev_access.domain,
op->u.pcidev_access.bus,
op->u.pcidev_access.dev,
return 0;
}
+void physdev_modify_ioport_access_range( struct domain *d, int enable,
+ int port, int num )
+{
+ int i;
+ ASSERT( d->arch.iobmp_mask );
+ for ( i = port; i < port+num; i++ )
+ {
+ if(enable)
+ clear_bit(i, d->arch.iobmp_mask);
+ else
+ set_bit(i, d->arch.iobmp_mask);
+ }
+}
+
/* Add a device to a per-domain device-access list. */
static int add_dev_to_task(struct domain *d, struct pci_dev *dev, int acc)
{
#include <xen/reboot.h>
#include <xen/sched.h>
#include <xen/serial.h>
+#include <xen/physdev.h>
#include <asm/io.h>
/* Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
uart->lock = SPIN_LOCK_UNLOCKED;
}
+void serial_endboot()
+{
+ int i;
+
+ for (i=0;i<sizeof(com)/sizeof(struct uart);i++)
+ {
+ if( UART_ENABLED(&com[i]) )
+ {
+ /* remove access */
+ physdev_modify_ioport_access_range( dom0, 0, com[i].io_base, 8 );
+ }
+ }
+
+}
+
/*
* Local variables:
* mode: C
--- /dev/null
+/******************************************************************************
+ * physdev.h
+ */
+
+#ifndef __XEN_PHYSDEV_H__
+#define __XEN_PHYSDEV_H__
+
+#include <public/physdev.h>
+
+void physdev_modify_ioport_access_range( struct domain *d, int enable,
+ int port, int num );
+void physdev_destroy_state(struct domain *d);
+int physdev_pci_access_modify(domid_t dom, int bus, int dev, int func,
+ int enable);
+int domain_iomem_in_pfn(struct domain *p, unsigned long pfn);
+long do_physdev_op(physdev_op_t *uop);
+void physdev_init_dom0(struct domain *d);
+
+#endif /* __XEN_PHYSDEV_H__ */
void serial_force_unlock(int handle);
+void serial_endboot(void);
+
#endif /* __XEN_SERIAL_H__ */
/*